/*
 * Created on Jan 23, 2004
 *
 * To change the template for this generated file go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
package org.vectrics.user.client;

import java.awt.HeadlessException;
import java.awt.Dimension;
import java.util.Properties;

import javax.swing.JFrame;
import javax.swing.JPanel;

import org.vectrics.swing.GuiManager;

/**
 * @author mmoore
 *
 * To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
public class UserEditFrame extends JFrame {

	/**
	 * @throws java.awt.HeadlessException
	 */
	public UserEditFrame() throws HeadlessException {
		super();
		
		JPanel contentPane = (JPanel)this.getContentPane();
		contentPane.setLayout(null);
		contentPane.setPreferredSize(new Dimension(WIDTH, HEIGHT));
		contentPane.setMinimumSize(new Dimension(WIDTH, HEIGHT));
		contentPane.setMaximumSize(new Dimension(WIDTH, HEIGHT));
		contentPane.setFont(GuiManager.getInstance().getStandardFont());
		
		UserEditPanel userEditPanel = new UserEditPanel();
		this.getContentPane().add(userEditPanel);
		
		this.pack();

		Dimension screen = getToolkit().getScreenSize();
		int left = (screen.getSize().width - getSize().width) / 2;
		int top = (screen.getSize().height - getSize().height) / 2;
		this.setLocation(left, top);
		this.setTitle("User Maintenance");
	}
		
	public void setUserToEdit(Properties userProps) {
		this.setTitle("User: " + userProps.getProperty("lastName"));
	}

}
